package com.lagou.module2homewor;

/**
 * 通话套餐类
 */
public class CallPlan extends BasicPlan implements CallInterface{
    //通话时长
    private int lengthOfCall;
    //短信条数
    private int messageCount;
    //每月咨费
    private int monthlyMoney;

    //重写打印套餐信息方法
    @Override
    public void show(){
        System.out.println("通话套餐,通话时长" + lengthOfCall +"分钟"+ ",短信条数:"+messageCount+"条"+",每月咨费"+monthlyMoney+"元");
    }
    public CallPlan() {
    }

    public CallPlan(int lengthOfCall, int messageCount, int monthlyMoney) {
        this.lengthOfCall = lengthOfCall;
        this.messageCount = messageCount;
        this.monthlyMoney = monthlyMoney;
    }

    public int getLengthOfCall() {
        return lengthOfCall;
    }

    public void setLengthOfCall(int lengthOfCall) {
        this.lengthOfCall = lengthOfCall;
    }

    public int getMessageCount() {
        return messageCount;
    }

    public void setMessageCount(int messageCount) {
        this.messageCount = messageCount;
    }

    public int getMonthlyMoney() {
        return monthlyMoney;
    }

    public void setMonthlyMoney(int monthlyMoney) {
        this.monthlyMoney = monthlyMoney;
    }

    /**
     * 实现通话接口
     * @param callTime  通话时长
     * @param iphoneCard 手机卡
     */
    @Override
    public void call(int callTime, IphoneCard iphoneCard) {
        System.out.println("手机卡："+iphoneCard.getCardNo()+",通话了"+callTime+"分钟！");
    }
}
